package util;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * Created by chencongcong
 * on 2018/7/31
 */
public class StringUtils {
    private static final Pattern pattern = Pattern.compile("\\s*|\t|\r|\n");

    /**
     * 去掉字符串中空格  \r \t \n等特殊字符
     *
     * @param str
     * @return
     */
    public static String replaceBlank(String str) {
        String dest = "";
        if (str != null) {
            Matcher m = pattern.matcher(str);
            dest = m.replaceAll("");
        }
        return dest;
    }
}
